var a = getApp();

Page({
    data: {
        lisNum: 10,
        isLoadMore: !0,
        page: 1,
        last_page: 0
    },
    onLoad: function(a) {
        this.setData({
            activity_id: a.id
        }), this.getrenshu();
    },
    onReachBottom: function() {
        this.data.isLoadMore && this._getMoreData();
    },
    getrenshu: function() {
        var t = a.getNetAddresss("plugin.activity-apply.api.activity.getDetails"), i = this;
        a._getNetWork({
            url: t,
            data: {
                activity_id: i.data.activity_id,
                page: 1
            },
            success: function(a) {
                var t = a.data;
                1 == t.result && (0 == t.data.data.length ? i.setData({
                    datalist: t.data.data,
                    isLoadMore: !1,
                    kong: !0
                }) : i.setData({
                    datalist: t.data.data,
                    last_page: t.data.last_page,
                    kong: !1
                }));
            },
            fail: function(a) {}
        });
    },
    _getMoreData: function() {
        var t = this, i = a.getNetAddresss("plugin.activity-apply.api.activity.getDetails");
        this.data.page >= this.data.last_page ? this.setData({
            isLoadMore: !1
        }) : (this.setData({
            page: this.data.page + 1
        }), a._getNetWork({
            url: i,
            data: {
                activity_id: this.data.activity_id,
                page: this.data.page
            },
            success: function(a) {
                if (1 == a.data.result) {
                    var i = a.data.data;
                    t.setData({
                        isLoadMore: !0,
                        datalist: t.data.datalist.concat(i.data)
                    });
                } else t.setData({
                    page: t.data.page - 1,
                    isLoadMore: !1
                });
            },
            fail: function(a) {}
        }));
    },
    onShareAppMessage: function() {}
});